<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>企业认证页面</title>
    <script src="/static/js/jquery.min.js"></script>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
        }
        .container {
            background-color: #fff;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            width: 300px;
            text-align: center;
        }
        .container h2 {
            margin-bottom: 20px;
        }
        .container input {
            width: 90%;
            padding: 10px;
            margin: 10px 0;
            border: 1px solid #ccc;
            border-radius: 4px;
        }
        .container button {
            width: 100%;
            padding: 10px;
            background-color: #4CAF50;
            color: #fff;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
        }
        .container button:hover {
            background-color: #45a049;
        }
    </style>
</head>
<body>
    <div class="container">
        <h2>企业认证</h2>
        <label for="company_name">公司名称:</label>
        <input type="text" id="company_name" name="company_name" required>
        <label for="contact">联系方式:</label>
        <input type="text" id="contact" name="contact" required>
        <button type="submit" onclick="set_company_name()">确认上交</button>
    </div>
</body>
<script>
    function set_company_name(){
        let company_name = document.getElementById('company_name').value,
        contact = document.getElementById('contact').value;
        $.ajax({
            url:'/index/users/save?id={$user_message.id}',
            type: 'post', // 请求类型，可以是 'GET' 或 'POST'  
            data:{corporate_name:company_name,mobile:contact},
            dataType: 'json', // 预期服务器返回的数据类型  
            success: function(res) {
                if(res.code == 200){
                    location.href = '/index/index';
                }
            }
        });
    }
</script>
</html>